<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>onMouseWheel (Callback)</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->onMouseWheel (Callback)<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>onMouseWheel (hWnd, delta, x, y) </p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>This callback is invoked when the mouse wheel is rotated. </p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hWnd<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the window which had input focus when the mouse wheel was rotated. <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->delta<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The distance and direction the wheel was rotated, see remarks for more information <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->x<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The x coordinate where the wheel was rotated. Relative to the upper left hand corner of the window <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->y<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The y coordinate where the wheel was rotated. Relative to the upper left hand corner of the window <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>0</p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>This is a callback function. You must supply this function yourself. Register this callback with the <a href="WinXRegOnMouseUp.htm">WinXRegOnMouseWheel</a> function.</p>
<p>If the delta parameter is positive, the mouse was rotated up, if it is negative, the mouse was rotated down. delta is always a multiple or division of 120. The scrolling of a single line is supposed to occur only when delta has reached 120. If delta is smaller than 120, you should add it to a static variable and not scroll untill that variable reaches 120. Alternatively you could scroll partial lines. If it is larger than 120 you should scroll several lines.</p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" -->
      <p class="codeStyle">FUNCTION onMouseWheel (hWnd, delta, x, y)</p>
      <blockquote>
        <p class="codeStyle">'which direction did the user scroll?<br>
          IF delta &lt; 0 THEN direction$ = &quot;down&quot; ELSE direction$ = &quot;up&quot; </p>
        <p class="codeStyle">          'assuming we have a console attached to this app,<br>
    'tell the user how many lines we scrolled<br>
    PRINT &quot;You scrolled &quot;;direction$;&quot; &quot;;delta/120;&quot; lines&quot;</p>
      </blockquote>
      <p class="codeStyle"> END FUNCTION </p>
    <!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="WinXRegOnMouseUp.htm">WinXRegOnMouseWheel</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
